package com.tobiasaigner.ast;

import org.apache.commons.lang.builder.EqualsBuilder;

import com.tobiasaigner.ast.visitor.Visitor;

/**
 * The call with current continuation implementation.
 * 
 * @author Michel Knoertzer & Vincent Marchal
 *
 */
public class CallCC extends Expression {

	private Expression expression;
	
	public CallCC() {}

	public Expression getExpression() {
		return expression;
	}

	public void setExpression(Expression expression) {
		this.expression = expression;
	}

	@Override
	public Object accept(Visitor v) {
        return v.visit(this);
	}
	
	@Override
    public boolean equals(Object other) {
        if (other instanceof CallCC) {
			CallCC callcc = (CallCC) other;
            return new EqualsBuilder()
            		.append(this.expression, callcc.expression)
                    .isEquals();
        }
        return false;
    }

}
